﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;

namespace CorsatAdminApp.Library.DataManager
{
    public static partial class Main
    {
        private static SqlConnection connection;
        private static SqlCommand command;
        private static SqlDataAdapter adapter;

        static Main()
        {
            connection = new SqlConnection(ConfigurationSettings.AppSettings["ConnectionString"].ToString());
            //connection = new SqlConnection("Server=GEORGE-PC\\MSSQLSERVER2008; Database=Corsat; user id =123; password=123;");
            command = new SqlCommand("", connection);

            adapter = new SqlDataAdapter(command);
        }

        private static void OpenConnection()
        {
            if (connection.State != ConnectionState.Open)
                connection.Open();
        }

        private static void CloseConnection()
        {
            if (connection.State != ConnectionState.Closed)
                connection.Close();
        }

    }
}
